﻿Namespace B1Objects
    Public Class FactoryB1Objects
        Private _SBOCompany As SAPbobsCOM.Company

        Sub New(ByVal SboCompany As SAPbobsCOM.Company)
            _SBOCompany = SboCompany
        End Sub

        Public Function CreateB1Objects(ByVal objType As EnumObjectTypes) As Object
            Dim obj As Object = Nothing
            Select Case objType
                Case EnumObjectTypes.ot_Recordset
                    Dim oRs As SAPbobsCOM.Recordset
                    oRs = _SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                    obj = New Recordset(oRs)
            End Select
            Return obj
        End Function

    End Class

End Namespace

